V2EX  ›  英汉词典

IoC Container

释义 Definition

IoC Container(控制反转容器):一种软件框架组件,用来创建、管理对象的生命周期,并在需要时自动把依赖(dependencies)注入到对象中。常见于 Java 的 Spring、.NET 的 Autofac 等。也常与 DI(Dependency Injection,依赖注入) 搭配使用。

发音 Pronunciation (IPA)

/ˌaɪ.oʊˈsiː kənˈteɪnər/

例句 Examples

Spring is an IoC container.
Spring 是一个 IoC 容器。

An IoC container can construct services and inject their dependencies at runtime, which makes the code easier to test and maintain.
IoC 容器可以在运行时创建服务并注入其依赖,从而让代码更易测试和维护。

词源 Etymology

IoCInversion of Control(控制反转)的缩写,来源于软件工程中的一种设计思想:把“由谁来创建对象、如何把对象连接在一起”的控制权,从业务代码中反转交给框架/容器统一处理。后来这种负责装配对象与依赖的组件被称为 IoC container,并在企业级应用开发中广泛流行。

相关词 Related Words

文献与著作 Literary Works

  • Martin Fowler — Inversion of Control Containers and the Dependency Injection pattern(2004)
  • Craig Walls — Spring in Action
  • Mark Seemann — Dependency Injection in .NET
  • Robert C. Martin — Clean Architecture(讨论依赖规则与依赖注入相关实践)
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   672 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 14ms · UTC 19:34 · PVG 03:34 · LAX 11:34 · JFK 14:34
♥ Do have faith in what you're doing.